Ken Paxton, the attorney general, said it was the first enforcement action under a state ban on treatment.